<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="description" content="None">
  <meta name="author" content="Steven Watson">
  <link rel="shortcut icon" href="img/favicon.ico">
  <title>Getting Started - Chez-SDL</title>
  <link href='https://fonts.googleapis.com/css?family=Lato:400,700|Roboto+Slab:400,700|Inconsolata:400,700' rel='stylesheet' type='text/css'>

  <link rel="stylesheet" href="css/theme.css" type="text/css" />
  <link rel="stylesheet" href="css/theme_extra.css" type="text/css" />
  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css">
  
  <script>
    // Current page data
    var mkdocs_page_name = "Getting Started";
    var mkdocs_page_input_path = "index.md";
    var mkdocs_page_url = null;
  </script>
  
  <script src="js/jquery-2.1.1.min.js" defer></script>
  <script src="js/modernizr-2.8.3.min.js" defer></script>
  <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script> 
  
</head>

<body class="wy-body-for-nav" role="document">

  <div class="wy-grid-for-nav">

    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side stickynav">
      <div class="wy-side-nav-search">
        <a href="." class="icon icon-home"> Chez-SDL</a>
        <div role="search">
  <form id ="rtd-search-form" class="wy-form" action="./search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" title="Type search term here" />
  </form>
</div>
      </div>

      <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
	<ul class="current">
	  
          
            <li class="toctree-l1 current">
		
    <a class="current" href=".">Getting Started</a>
    <ul class="subnav">
            
    <li class="toctree-l2"><a href="#setup-guide">Setup Guide</a></li>
    
        <ul>
        
            <li><a class="toctree-l3" href="#windows">Windows</a></li>
        
            <li><a class="toctree-l3" href="#macos-linux">macOS &amp; Linux</a></li>
        
        </ul>
    

    <li class="toctree-l2"><a href="#navigating-documentation">Navigating Documentation</a></li>
    

    </ul>
	    </li>
          
            <li class="toctree-l1">
		
    <a class="" href="sdl/">Overview of SDL 2</a>
	    </li>
          
            <li class="toctree-l1">
		
    <span class="caption-text">Tutorials</span>
    <ul class="subnav">
                <li class="">
                    
    <a class="" href="tuts/events/">Handling Events</a>
                </li>
                <li class="">
                    
    <a class="" href="tuts/renderer/">Renderer Basics</a>
                </li>
                <li class="">
                    
    <a class="" href="tuts/advanced-renderer/">Renderer Techniques</a>
                </li>
                <li class="">
                    
    <a class="" href="tuts/tetris/">Complete Example: Tetris</a>
                </li>
    </ul>
	    </li>
          
            <li class="toctree-l1">
		
    <span class="caption-text">Reference</span>
    <ul class="subnav">
                <li class="">
                    
    <a class="" href="ref/basics/">Basics</a>
                </li>
                <li class="">
                    
    <a class="" href="ref/video/">Video</a>
                </li>
                <li class="">
                    
    <a class="" href="ref/audio/">Audio</a>
                </li>
                <li class="">
                    
    <a class="" href="ref/events/">Events</a>
                </li>
                <li class="">
                    
    <a class="" href="ref/inputs/">Inputs</a>
                </li>
                <li class="">
                    
    <a class="" href="ref/force/">Force Feedback</a>
                </li>
                <li class="">
                    
    <a class="" href="ref/power/">Power Management</a>
                </li>
                <li class="">
                    
    <a class="" href="ref/timers/">Timers</a>
                </li>
                <li class="">
                    
    <a class="" href="ref/values/">Values</a>
                </li>
                <li class="">
                    
    <a class="" href="ref/data/">Data Objects</a>
                </li>
    </ul>
	    </li>
          
        </ul>
      </div>
      &nbsp;
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" role="navigation" aria-label="top navigation">
        <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
        <a href=".">Chez-SDL</a>
      </nav>

      
      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="breadcrumbs navigation">
  <ul class="wy-breadcrumbs">
    <li><a href=".">Docs</a> &raquo;</li>
    
      
    
    <li>Getting Started</li>
    <li class="wy-breadcrumbs-aside">
      
        <a href="https://github.com/steven741/chez-sdl/edit/master/docs/index.md"
          class="icon icon-github"> Edit on GitHub</a>
      
    </li>
  </ul>
  <hr/>
</div>
          <div role="main">
            <div class="section">
              
                <p>SDL2 is a cross platform library for interfacing with multimedia and HID hardware and software devices. The library is free, open-source and, currently has permissive licensing. SDL2 is suitable for professional products and, has found use in both large and small projects.</p>
<h1 id="setup-guide">Setup Guide</h1>
<p>In general, setting up an environment to work with Chez-SDL is about the same across all supported platforms.</p>
<ul>
<li>Install Chez Scheme</li>
<li>Install the SDL2 development library</li>
<li>Install Chez-SDL</li>
</ul>
<p>It is always recommended to build Chez Scheme from it's source code.</p>
<h2 id="windows">Windows</h2>
<h3 id="installing-chez-scheme">Installing Chez Scheme</h3>
<p>For an installation on Windows, a development environment should have the following installed:</p>
<ul>
<li><a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10">Windows Subsystem for Linux</a></li>
<li><a href="https://visualstudio.microsoft.com/vs/community/">Visual Studio Community</a></li>
<li><a href="https://wixtoolset.org/releases/">WiX Toolset</a></li>
<li><a href="https://www.libsdl.org/download-2.0.php">SDL2</a></li>
</ul>
<p>The <a href="https://github.com/cisco/ChezScheme/blob/master/BUILDING#L229">documentation</a> for building Chez provides instructions for building on Windows.</p>
<h3 id="install-libsdl2">Install libSDL2</h3>
<p>Navigate to <a href="https://www.libsdl.org/download-2.0.php">SDL2's website</a> and, download the runtime library. This guide will be using the the 64-bit version. Unzip the library and place the dll file in a directory for libraries. This can be any directory of your choosing. I recommend placing the file in Chez's installation directory.</p>
<p>A highly recommended alternative would be to use a package manager for Windows like <a href="https://www.msys2.org/">MSYS2</a>. This will handle downloading, installing, and maintaining the library for you. All that's required for installing the library is a single command.</p>
<pre><code class="bash">pacman -S mingw-w64-x86_64-SDL2
</code></pre>

<h3 id="install-chez-sdl">Install Chez-SDL</h3>
<p>To install Chez-SDL, simply clone the repository into a directory for your Chez libraries. This can be any directory of your choosing.</p>
<pre><code class="bash">git clone https://github.com/steven741/chez-sdl.git
</code></pre>

<p>Add the path of the library to <code>CHEZSCHEMELIBDIRS</code> and, verify that sdl can be imported in Chez.</p>
<h2 id="macos-linux">macOS &amp; Linux</h2>
<p>Building on macOS and Linux is about the same. For macOS, common development tools should be installed. <a href="https://developer.apple.com/xcode/">Xcode</a> with CLI tooling and <a href="https://brew.sh/">brew</a>. The most common Linux distributions should have the required tools and libraries avaliable in their package manager.</p>
<p>The <a href="https://github.com/cisco/ChezScheme/blob/master/BUILDING">documentation</a> for building Chez goes into enough detail for building on a *nix type system and, I will only go over a brief overview here.</p>
<p>Install libuuid, libncurses and, libX. Install the typical GNU build tools like gcc and make. Run <code>./configure</code> and <code>make</code>. If project builds correctly run <code>make install</code>. To install the SDL2 bindings clone the Chez-SDL repo somewhere and, export <code>CHEZSCHEMELIBDIRS</code> with the path to the library's source.</p>
<h1 id="navigating-documentation">Navigating Documentation</h1>
<p>The documentation is seperated into 2 main parts. There is a section containing tutorials and, there is an API reference guide.</p>
<p>The tutorials move at a very fast pace and, try to cover as much useful information as possible. They are provided to give a realistic overview of using SDL2 with Chez.</p>
<p>The API reference guide contains all the SDL2 procedures avaliable in the library. The entries also provide details about any inconsistencies in the interface. The conventional C function names are provided where applicable to help improve searchability of procedures.</p>
              
            </div>
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="sdl/" class="btn btn-neutral float-right" title="Overview of SDL 2">Next <span class="icon icon-circle-arrow-right"></span></a>
      
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <!-- Copyright etc -->
    
      <p><a rel="license" href="http://creativecommons.org/licenses/by/4.0/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by/4.0/80x15.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.</p>
    
  </div>

  Built with <a href="http://www.mkdocs.org">MkDocs</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
      
        </div>
      </div>

    </section>

  </div>

  <div class="rst-versions" role="note" style="cursor: pointer">
    <span class="rst-current-version" data-toggle="rst-current-version">
      
          <a href="https://github.com/steven741/chez-sdl/" class="fa fa-github" style="float: left; color: #fcfcfc"> GitHub</a>
      
      
      
        <span style="margin-left: 15px"><a href="sdl/" style="color: #fcfcfc">Next &raquo;</a></span>
      
    </span>
</div>
    <script>var base_url = '.';</script>
    <script src="js/theme.js" defer></script>
      <script src="search/main.js" defer></script>

</body>
</html>

<!--
MkDocs version : 1.0.4
Build Date UTC : 2020-01-03 22:09:31
-->
